<?php


namespace app\validate;

use think\Validate;


class VipValidate extends Validate
{
    protected $rule = [
        'title' => 'require',
        'image_url' => 'require',
        'original_price' => 'require|float',
        'discount_price' => 'require|float',
        'min_price' => 'require|float',
        'duration' => 'require|integer',
        'purchase_limit' => 'require|integer',
    ];

    protected $message = [
        'title.require' => 'VIP名称必须填写',
        'image_url.require' => '商品图URL必须填写',
        'original_price.require' => '原价必须填写',
        'original_price.float' => '原价必须为浮点型数字',
        'discount_price.require' => '优惠价必须填写',
        'discount_price.float' => '优惠价必须为浮点型数字',
        'min_price.require' => '最低价必须填写',
        'min_price.float' => '最低价必须为浮点型数字',
        'duration.require' => '持续时间必须填写',
        'duration.integer' => '持续时间必须为整数',
        'purchase_limit.require' => '可购买次数必须填写',
        'purchase_limit.integer' => '可购买次数必须为整数',
    ];

}